<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('尾程单详情')" />
	<th:block th:include="include :: businessCSS" />
	<style>
        .main-content{position: relative;}
        .topbtns{position:fixed;top: 0;width: 100%;z-index: 9999;background-color: #fff;}
		.preservationBtn{padding: 10px;margin: 0;position: fixed;top: 0;z-index: 9999;background: #fff;width: 100%;}
		.preservationBtn input{font-size: 16px;background-color: rgb(80, 138, 238);color: #fff;border: none;padding: 5px 30px;border-radius: 5px;cursor: pointer;}
		/* .layui-border-box{height: 350px !important;}
		.layui-table-body{height: 240px !important;} */
		.layui-table-tool-temp{padding-right: 30px;}
        .getDetailUpload,.getDetailUpload2{cursor: pointer;}
        .layui-table-tool-self{display: none;}
        .listext th{background:#eee;color:#3366cc;}
        .listext th,.listext td{border:solid 1px #ddd;text-align:left;padding:10px;font-size:14px;}
        .importTable{empty-cells:show;border-collapse:collapse;border-spacing:0;}
	</style>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
        <div class="north">
<!--            <th:block th:include="include :: business_btn" />-->
            <th:block th:include="include :: business_tp2('top')" />
        </div>
        <div style="width: 100%;height: 10px;background: #f6f6f6;"></div>
        <div>
            <table class="layui-hide" id="xqdhtable" lay-filter="xqtable"></table>
            <script type="text/html" id="xqtoolbar">
                <div style="padding: 16px;display: flex;justify-content: space-between;">
                    <div  style="font-weight: 700;font-size: 18px;">海外尾程单详情</div>
                </div>
            </script>
        </div>
        <th:block th:include="include :: pageFooter" /> 
    </form>
	</div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: inlineJS" />
<th:block th:include="include :: searchJS" />
<script th:src="@{/dhecp/js/queryCondition.js}"></script>
<th:block th:include="listinclude :: list-templeat" />

<script th:inline="javascript">
	/*<![CDATA[*/
	var fields = [[${fields}]];
    var fieldsList = [[${fieldsList}]];
	var fieldsHiddenList = [[${fieldsHiddenList}]];
	var moduleTable = [[${moduleTable}]];
	var enableEdit = [[${enableEdit}]];
    //商品表格基础信息
	var gridColumns = [[${gridColumns}]];
	var gridColumnsZJ = [[${gridColumnsZJ}]];
	var hwTailprogram = [[${hwTailprogram}]];
    // 商品列表数据
    var List=[[${List}]];
    var tablecolsFh=hwTailprogram.creationMethod == '手动'?tablecolsFh():tablecolsZD();
    if (hwTailprogram.creationMethod == '自动'){
        //根据coleSize编辑出多少个箱子
        for (let i = 0; i < hwTailprogram.numbox; i++) {
            let  tableData = {
                "align": "center",
                "field": "numRealityDeliver"+(i+1),
                "title": "箱子"+(i+1),
                "width": 95,
            }
            tablecolsFh[0].push(tableData);
        }
        //将箱子数据赋值
        if (hwTailprogram.numbox != 0){
            for (let i = 0; i < List.length; i++) {
                let ss = List[i].boxList.slice(1,List[i].boxList.length-1)
                let aa =  ss.split(",");
                for (let j = 0; j < aa.length; j++) {
                    let numRe = 'numRealityDeliver'+(j+1)
                    List[i][numRe] = aa[j]==0?"":$.trim(aa[j])
                }
            }
        }
    }

    //子件列表数据
    var element,thStr;
    var fieldWidth = {},		//导入列表字段宽度
        filedRequired = {},		//导入列表必填字段
        dateFiled = [],			//导入列表日期字段
        hasNull = false;		//导入数据必填字段有空值
    $.each(gridColumnsZJ.dictionaryForPageFieldList,function(i,v){
        fieldWidth[v.fields] = v.fieldFrontWidth
        if(v.fieldFrontRequired)filedRequired[v.fields] = v.fieldName;
        if(v.fieldFrontType == 't_date')dateFiled.push(v.fields);
    })

	var $,layer,form,table,nid,noTable;

    layui.use(['laydate','form','layer','jquery','util','element','upload','table'], function () {
        $ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element,upload = layui.upload,table = layui.table;
        beforeInit();//表单初始化之前的动作集合
		//初始化操作
		headcom3()
        nid=$('#nid').val()
         // 保存按钮事件变化
        $(function(){
           $('.tp-save').attr('onclick','')
           $('.tp-save').attr('lay-filter','btn-edit')
           $('.tp-save').attr('lay-submit',true)
        })

        var listData2=List ?List:[]

        $.tablelist.init({
            elem: '#xqdhtable'
            ,data: listData2
            , page: false
            , even: true
            , limit: 10000
            , totalRow: false
            , cols: tablecolsFh
            , toolbar: '#xqtoolbar'
            , defaultToolbar: [{title: '列设置', layEvent: 'fieldSet', icon: 'layui-icon-set'}]
            , height: '320'
            , done: function (res, curr, count) {
                listData2 = table.cache.xqdhtable;//每次重载都赋值更新表缓存
            },success:function(a,b,c){
                // console.log(a,b,c,9999)
            }
        });
    });
</script>

</body>
</html>